{% extends 'users/base.html' %}
{% load form_helpers %}

{% block title %}Change Password{% endblock %}

{% block usercontent %}
    <form action="." method="post" class="form form-horizontal col-md-10 col-md-offset-1">
        {% csrf_token %}
        {% if form.non_field_errors %}
            <div class="panel panel-danger">
                <div class="panel-heading"><strong>Errors</strong></div>
                <div class="panel-body">
                    {{ form.non_field_errors }}
                </div>
            </div>
        {% endif %}
        <div class="panel panel-default">
            <div class="panel-heading"><strong>Password</strong></div>
            <div class="panel-body">
                {% render_field form.old_password %}
                {% render_field form.new_password1 %}
                {% render_field form.new_password2 %}
            </div>
        </div>
        <div class="text-right">
            <button type="submit" name="_update" class="btn btn-primary">Update</button>
            <a href="{% url 'user:profile' %}" class="btn btn-default">Cancel</a>
        </div>
    </form>
{% endblock %}
